<extend name="Public/common"/>
<block name="othercss">
<script type="text/javascript">
            var url_get_address = "{:U('get_address_info')}";
            var url_del_address = "{:U('Member/address_del')}";
            var url_add_address = "{:U('Member/address_add',array('type'=>'ajax'))}";
            var url_edit_address = "{:U('Member/address_edit',array('type'=>'ajax'))}";
            var url_checkout = "{:U('checkout')}";
            var url_success = "{:U('PayWechat/pay')}";
			var url_success2 = "{:U('PayAlipay/pay')}";
			var url_success3 = "{:U('success')}";
            var url_count_delivery = "{:U('count_delivery')}";
			
			var url_province_sel = "{:U('Address/province_list')}?";
			
			var url_city_sel = "{:U('Address/city_sel')}?";//根据省份获取城市列表
            var url_area_sel = "{:U('Address/area_sel')}?";//根据城市获取地区列
			var url_get_zip = "{:U('Address/get_zip')}?";//根据地区获取邮政编码
			var url_address_add = "{:U('Member/address_add')}?";//添加收货地址请求地址
</script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/common/artDialog6/css/ui-dialog.css" />
<script type="text/javascript" src="__PUBLIC__/common/artDialog6/dist/dialog-plus-min.js"></script>

 <script src="{$theme_path}/js/check.js?v=20190408_1"></script>
  <script src="{$theme_path}/js/member_address_ajax.js?201904080_15"></script>
</block>
<block name="header">
<div class="header">
    <div class="clearfix box">
        <!--<a class="save">保存</a>-->
        <a class="return" href="javascript:history.back(-1)"><i class="return-icon"></i></a>
        <h2>确认订单</h2>
    </div>
</div>
</block>
<block name="body">
<div class="container pt50">
    <!--地址-->
     <if condition="$address_default_id gt 0">
    <a id="loc">
        <div class="vip2_loc">
            
            <div class="clearfix top">
                <div class="number">{$address_default.phone}</div>
                <div class="name">收货人：{$address_default.realname}</div>
            </div>
            <div class="clearfix">
                <div class="loc">收货地址：{$address_default.province} {$address_default.city} {$address_default.area} {$address_default.address}
                   
                </div>
                <img src="{$theme_path}/images/icon-loc.png" width="20"/>
            </div>
        </div>
    </a>
    <else/>
        <a>
      <a id="loc" class="add_now">
        <div class="vip2_loc">
            <div class="clearfix center">
           
                <img src="{$theme_path}/images/icon-loc.png" width="20"/> 添加地址
            </div>
        </div>
    </a>
    </a>
    </if>
      <input type="hidden" name="pay_type" id="pay_type" value="1" />
      <input type="hidden" name="sel_address_id" id="sel_address_id" value="{$address_default_id}" />
      
    <!--商品-->
 <div class="vip2_sum">
  <foreach name="cart_list" item="cart_item">
        <a class="pro-cell clearfix"  href="{:U('Goods/index',array('id'=>$cart_item['goods_id']))}">
            <img src="__ROOT__{$cart_item.picture}"/>
            <div class="lans clearfix">
                <div class="right">
                    <div class="price">¥ {$cart_item.price}</div>
                    <div class="number">x {$cart_item.num}</div>
                </div>
                <div class="left">
                    <div class="title twos">{$cart_item.goods_name}
                    </div>
                    <div class="mess">{$cart_item.spec_array}</div>
                </div>
            </div>
        </a>
        </foreach>

    </div>
    <!--总计-->
    <ul class="vip2_total clearfix">
  
        <li>商品总价<span>¥ {$cart_total|tofixed=2}</span></li>
    </ul>
    <div class="beizhu">
        <textarea  name="remark_member" id="remark_member" placeholder="备注"></textarea>
    </div>
    <div class="wjmm wjmm-sum">
        <dl class="clearfix vheng" id="radio" >
            <dd class="clearfix on">
                <img src="{$theme_path}/images/yuan-off.png" width="20"/>
                <img src="{$theme_path}/images/yuan-on.png" width="20"/>微信支付
                <input type="radio" class="radios" name="payment" value="微信" checked="checked" />
            </dd>
            <dd class="clearfix">
                <img src="{$theme_path}/images/yuan-off.png" width="20"/>
                <img src="{$theme_path}/images/yuan-on.png" width="20"/>支付宝支付
                <input type="radio" class="radios" name="payment" value="支付宝" />
            </dd>
        </dl>
        <dl>
            <div class="psfangshi clearfix">
                <div class="right">¥ <span class="red" id="span_total_delivery">0.00</span></div>
                配送方式：
                <div class="select">
                
          
                    
                    <select name="sel_delivery_id" id="sel_delivery_id" >
                    <option value="0">请选择配送方式</option>
                      <foreach name="delivery" item="delivery_item">
                        <option value="{$delivery_item.delivery_id}">{$delivery_item.delivery_name}</option>
                       </foreach>
                    </select>
                </div>
            </div>
            <div class="psfangshi  clearfix">配送时间：
                <div class="select">
                    <select  name="delivery_time" id="delivery_time">
                        <option value="任何时间">任何时间</option>
                        <option value="工作日">工作日</option>
                        <option value="非工作日">非工作日</option>
                    </select>
                </div>
            </div>
        </dl>
        <dl class="psfangshi1">
           <if condition="$config.point_pay_can eq 1">
            <dd class="clearfix checked_point" <if condition="$member_point elt 0">style="display:none"</if>  onclick="use_point_on()">
                <img src="{$theme_path}/images/yuan-off.png" width="20"/>
                <img src="{$theme_path}/images/yuan-on.png" width="20"/>
                使用积分
                <input type="hidden" value="0" id="use_point_on" name="use_point_on"  />
                  <div class="point_use" style="display:none"><input type="text" name="txt_pay_point" id="txt_pay_point" value="{$member_point}" class="txt"/> 
                  (本次最多使用<span id="span_max_point"></span>积分，最多抵扣<span id="span_max_point_money"></span>元)
                   </div>
                
                <div class="lan-right">您有积分：<span style="color: #dd2727">{$member_point}</span></div>
            </dd>
              <dd class="clearfix"  id="li_total_pay_point" style="display:none">
               积分抵扣
               <div class="lan-right">￥- <span style="color: #dd2727" id="span_total_pay_point_money">0.00</span></div>
              
              </dd>
             </if>

             <notempty name="youhuiquan"> 
            <dd class="clearfix">
                优惠券
                <input type="checkbox" class="checkboxs" checked="checked" value="{$youhuiquan.id}" money="{$youhuiquan.money}" onclick="sel_yhq()" name="yhq_ids">
                <div class="lan-right">￥- <span style="color: #dd2727">{$youhuiquan.money}</span></div>
            </dd>
             </notempty>
        </dl>
    </div>
</div>

<div class="footer-loc" id="f-loc">
    <div class="js-btn">
        <div class="j1">共2件</div>
        <div class="j2">合计&nbsp;&nbsp;&nbsp;￥&nbsp;<span style="font-size: 18px"  id="span_total_pay">{$cart_total|tofixed=2}</span></div>
    </div>
    <a class="new-loc1" onclick="checkout();">提交订单</a>
</div>

<!--弹出层-->
<div class="bg-black" ></div>
<!--选择地址-->
<div class="loc_windown" id="lw">
    <div class="container" style="padding:10px 0">
        <a class="closes clearfix" >
            &nbsp;&nbsp;选择地址<img src="{$theme_path}/images/close_icon.png" width="40">
        </a>
        <ul class="ssdz1 ssdz-win">
        <volist name="address_list" id="item">
            <li class="clearfix" onclick="get_mmeber_address({$item.id});">
                <div class="lans" style="padding-left: 15px">
                    <div class="clearfix">
                        <div class="right">{$item.phone}</div>
                        <div class="left">收货人：{$item.realname}</div>
                    </div>
                    <div class="t1"><span style="color: #DD2727"><eq name="item['is_default']" value="1">[默认地址]</eq></span>收货地址：{$item.province} {$item.city} {$item.area} {$item.address}
                    </div>
                </div>
            </li>
            </volist>
    
        </ul>
          <a class="new-loc" id="new_loc">新增收货地址</a>
    </div>
 
</div>
<!--新增地址-->
<div class="loc_windown" id="lw1">
    <div class="container" style="padding:10px 0">
        <a class="closes clearfix" >
            &nbsp;&nbsp;选择地址<img src="{$theme_path}/images/close_icon.png" width="40">
        </a>
        <div class="wjmm" id="new_loc_content">
            <dl>
                <dd class="clearfix">
                    <input type="text"   id="realname" name="realname"  class="text2" placeholder="收件人"/>
                </dd>
               
            </dl>
            <dl>
                <dd class="clearfix" >
                 <span id="span_province">
                 <select name="province" id="province" >
                                        <option value="">选择省份</option>
                                        <foreach name="province" item="prov">
                                            <option value="{$prov.province}">{$prov.province}</option>
                                        </foreach>
                     </select>
                    </span>
                 <span id="span_city"></span>
                 <span id="span_area"></span>
                </dd>
              
              
                <dd class="clearfix">
                    <input type="text" class="text2"  name="address" id="address" placeholder="详细地址"/>
                </dd>
                 <dd class="clearfix">
                    <input type="text"  name="phone" id="phone" class="text2" placeholder="手机号 - 中国+86"/>
                </dd>
                <dd class="clearfix">
                    <input type="text" class="text2" name="zip" id="zip" placeholder="邮政编码"/>
                </dd>
                <dd style="font-size:14px;">  <label><input type="checkbox" name="is_default" id="is_default" value="1" onclick="sel_all(this.form)" checked="checked" ><span></span></label>设置为默认地址 <span style="color:#F00; display:inline-block; margin-left:20px;" id="err_msg"></span></dd>
            </dl>
            <div class="wjmm-sub">
            </div>
            <a class="new-loc" id="btn_add">确认新增此地址</a>
        </div>
    </div>

    </div>
<!--弹出新增地址窗-->
<div class="loc-select">
    <i class="close "><img src="{$theme_path}/images/close_icon1.png" width="25"/> </i>
    <div class="title1" id="had_selected">请选择</div>

    <div class="title">选择省市/地区</div>
    <div class="place-cell2" id="province_city_area">
    
    </div>
</div>
</block>
<block name="otherjs">
            <input type="hidden" name="member_money" id="member_money" value="{$member_money}" />
                <input type="hidden" name="member_point" id="member_point" value="{$member_point}" />
                <input type="hidden" name="total_weight" id="total_weight" value="{$total_weight}" />
                <input type="hidden" name="total_cart" id="total_cart" value="{$cart_total|tofixed=2}" />
                <input type="hidden" name="total_delivery" id="total_delivery" value="0.00" />
                <input type="hidden" name="total_pay" id="total_pay" value="{$cart_total|tofixed=2}" />
                <input type="hidden" name="total_pay_money" id="total_pay_money" value="0" />
                <input type="hidden" name="total_point" id="total_point" value="0" />
                <input type="hidden" name="total_pay_point_money" id="total_pay_point_money" value="0" />
                <input type="hidden" name="point_1_to_money" id="point_1_to_money" value="{$config.point_1_to_money}" />
                <input type="hidden" name="point_pay_percent" id="point_pay_percent" value="{$config.point_pay_percent}" />
                <input type="hidden" name="max_point" id="max_point" value="0" />
                <input type="hidden" name="id" id="id" value="{$id}" />
                <input type="hidden" name="yhq_ids" id="yhq_ids" value="" /> 
                <input type="hidden" name="yhq_money" id="yhq_money" value="0" /> 


<script>
    $(function () {
        // 支付单选框
        $('#radio dd').click(function () {
            $(this).addClass('on').siblings('dd').removeClass('on');
            $('#radio .radios').attr("checked",false);
            $(this).children('.radios').attr("checked","checked");
        })
        // 积分和优惠券复选框
		/*
        $('.psfangshi1 dd').click(function () {
            if ($(this).hasClass('on')){
                $(this).removeClass('on');
                $(this).children('.checkboxs').attr("checked",false);
            } else{
                $(this).addClass('on');
                $(this).children('.checkboxs').attr("checked","checked");
            }
        })
		*/
        // 地址弹出层
        $('#loc').click(function () {
            $('.bg-black').fadeIn();
            $('#lw').fadeIn();
            $('#f-loc').fadeOut();
        })
        // 关闭
		

        $('.closes').click(function () {
            $(this).parents('.loc_windown').fadeOut();
            $('.bg-black').fadeOut();
            $('#f-loc').fadeIn();
        })
		
        $('#loc-select').click(function () {
			
			$("#province_city_area").load(url_province_sel);//获得省份列表
            $('.loc-select').fadeIn();
            $('.bg-black').fadeIn();
        })
        $('.close').click(function () {
            $('.loc-select').fadeOut();
        })
        // 弹出新增地址
        $('#new_loc,.add_now').click(function () {
            $('.bg-black').fadeIn();
            $('#lw1').fadeIn();
            $('#lw').fadeOut();
        })
    })
</script>
 <notempty name="youhuiquan"> 
   <script type="text/javascript">
	sel_yhq();
    </script>
   </notempty>
</block>
<block name="footer">
</block>

